package com.lijiajia.cloud.common.security.publiser;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.security.authentication.event.AbstractAuthenticationEvent;

/**
 * 认证事件 通知
 *
 * @author lijiajia
 * @since 2019-05-30
 */
@Slf4j
public class AuthenticationLogApplicationEventPublisher implements ApplicationEventPublisher {
    @Override
    public void publishEvent(ApplicationEvent event) {
        if (event instanceof AbstractAuthenticationEvent) {
            log.debug("auth result: {}", event);
        }
    }

    @Override
    public void publishEvent(Object event) {
    }
}
